﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="系统日志1.aspx.cs" Inherits="分类_920_系统_信息_系统日志_1_1" %>
<%@ Import Namespace="System.Diagnostics" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
</head>
<body>
<%
    
    EventLog alog = new EventLog();
    alog.Log = "System";
    alog.MachineName = ".";
    string strImage = "";


    Response.Write("<p>there are "+alog.Entries.Count+" entries in the System event log.</p>");
    foreach(EventLogEntry entry in alog.Entries){
        switch(entry.EntryType){
            case EventLogEntryType.Warning:
                strImage = "warning.png";
                break;
            case EventLogEntryType.Error:
                strImage = "error.png";
                break;
            default:
                strImage = "info.png";
                break;
                
            
        }

        //Response.Write("<img src='"+strImage+"'>|");
        Response.Write(entry.TimeGenerated.ToString()+"|");
        Response.Write(entry.Source+"|");
        Response.Write(entry.EventID.ToString()+"<br>\r\n");
        
    }
    
    
     %>
</body>
</html>
